

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The userInput module &mdash; pyamp v1.2 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="pyamp v1.2 documentation" href="../index.html" />
    <link rel="up" title="The input module" href="mod_pyamp_ui_input.html" />
    <link rel="next" title="The web module" href="mod_pyamp_web.html" />
    <link rel="prev" title="The evdev module" href="pyamp_ui_input_evdev.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="mod_pyamp_web.html" title="The web module"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_evdev.html" title="The evdev module"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">pyamp v1.2 documentation</a> &raquo;</li>
          <li><a href="mod_pyamp.html" >The pyamp module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui.html" >The ui module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui_input.html" accesskey="U">The input module</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyamp.ui.input.userInput">
<span id="the-userinput-module"></span><h1>The userInput module<a class="headerlink" href="#module-pyamp.ui.input.userInput" title="Permalink to this headline">¶</a></h1>
<p>The userInput module contains the UserInput class which provides
the ability to process keyboard presses from a user and call a specific
function when certain keys are received.</p>
<div class="section" id="the-device-class">
<h2>The Device class<a class="headerlink" href="#the-device-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-36c183d60e2d87a0674a2139238eef79fef66ec2.png" alt="Inheritance diagram of pyamp.ui.input.userInput.Device" usemap="#inheritancea176c7c900" class="inheritance"/>
<map id="inheritancea176c7c900" name="inheritancea176c7c900">
<area shape="rect" href="pyamp_ui_input_evdev.html#pyamp.ui.input.evdev.BaseDevice" title="pyamp.ui.input.evdev.BaseDevice" alt="" coords="5,7,240,33"/>
<area shape="rect" href="../ui.html#pyamp.ui.input.evdev.Device" title="pyamp.ui.input.evdev.Device" alt="" coords="21,84,224,111"/>
</map>
</p>
<dl class="class">
<dt id="pyamp.ui.input.userInput.Device">
<em class="property">class </em><tt class="descclassname">pyamp.ui.input.userInput.</tt><tt class="descname">Device</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#pyamp.ui.input.userInput.Device" title="Permalink to this definition">¶</a></dt>
<dd><p>An abstract input device attached to a Linux evdev device node</p>
<dl class="method">
<dt id="pyamp.ui.input.userInput.Device.poll">
<tt class="descname">poll</tt><big>(</big><big>)</big><a class="headerlink" href="#pyamp.ui.input.userInput.Device.poll" title="Permalink to this definition">¶</a></dt>
<dd><p>Receive and process all available input events</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.Device.readMetadata">
<tt class="descname">readMetadata</tt><big>(</big><big>)</big><a class="headerlink" href="#pyamp.ui.input.userInput.Device.readMetadata" title="Permalink to this definition">¶</a></dt>
<dd><p>Read device identity and capabilities via ioctl()</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.Device.update_EV_ABS">
<tt class="descname">update_EV_ABS</tt><big>(</big><em>event</em><big>)</big><a class="headerlink" href="#pyamp.ui.input.userInput.Device.update_EV_ABS" title="Permalink to this definition">¶</a></dt>
<dd><p>Scale the absolute axis into the range [-1, 1] using absAxisInfo</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="the-userinput-class">
<h2>The UserInput class<a class="headerlink" href="#the-userinput-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-234d5435f7e9f461d3ab3be915077b54829e2eb0.png" alt="Inheritance diagram of pyamp.ui.input.userInput.UserInput" usemap="#inheritancead7f12fb8e" class="inheritance"/>
<map id="inheritancead7f12fb8e" name="inheritancead7f12fb8e">
<area shape="rect" href="#pyamp.ui.input.userInput.UserInput" title="pyamp.ui.input.userInput.UserInput" alt="" coords="5,7,251,33"/>
</map>
</p>
<dl class="class">
<dt id="pyamp.ui.input.userInput.UserInput">
<em class="property">class </em><tt class="descclassname">pyamp.ui.input.userInput.</tt><tt class="descname">UserInput</tt><big>(</big><em>keyboard</em>, <em>debug=False</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput" title="Permalink to this definition">¶</a></dt>
<dd><p>The UserInput class uses the <tt class="xref py py-mod docutils literal"><span class="pre">amp.ui.input.evdev</span></tt> module to
receive the user&#8217;s keyboard presses given the specific Linux
keyboard device.</p>
<p>This class provides to ability to add a series of callbacks for
specific keyboard presses. These functions will be called in the
event that the key presses occur.</p>
<ul class="simple">
<li>keyboard &#8211; The Linux keyboard device</li>
<li>debug &#8211; True for debugging mode, False otherwise</li>
</ul>
<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.addCode">
<tt class="descname">addCode</tt><big>(</big><em>key</em>, <em>code</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.addCode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.addCode" title="Permalink to this definition">¶</a></dt>
<dd><p>Add codes for given key press events. The key can be a tuple
where the first index is a list of keys and the second index is a
list of modifiers. Or it can be simply a list of keys, or it can
be a single key.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.addCodes">
<tt class="descname">addCodes</tt><big>(</big><em>keys</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.addCodes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.addCodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Add codes for given key press events. Each key in the keys
dictionary can be a tuple where the first index is a list of keys
and the second index is a list of modifiers. Or it can be simply a
list of keys, or it can be a single key.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.addKey">
<tt class="descname">addKey</tt><big>(</big><em>key</em>, <em>callback</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.addKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.addKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a single key to the key press cases. The key can be a tuple
where the first argument is the list of keys, or a single key, and the
second argument is a list of modifiers. Optionally, is can just be
a list of keys, or it can be a single key.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.addKeyList">
<tt class="descname">addKeyList</tt><big>(</big><em>keys</em>, <em>callback</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.addKeyList"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.addKeyList" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a list of keys mapped to a single function. Keys can be a tuple
where the first index the a list of keys, or a single key, and the
second index is the list of modifiers. Or it can be a list of keys, and
finally it can be just a single key.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.addKeys">
<tt class="descname">addKeys</tt><big>(</big><em>keys</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.addKeys"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.addKeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a key to the key press cases. The keys is a dictionary of
keys. Each key in the dictionary is a normal tuple form of a key,
and the value of the dictionary key is the callback method.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.userInput.UserInput.handleKeyPress">
<tt class="descname">handleKeyPress</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/userInput.html#UserInput.handleKeyPress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.userInput.UserInput.handleKeyPress" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle keys that are pressed.</p>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">The userInput module</a><ul>
<li><a class="reference internal" href="#the-device-class">The Device class</a></li>
<li><a class="reference internal" href="#the-userinput-class">The UserInput class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="pyamp_ui_input_evdev.html"
                        title="previous chapter">The evdev module</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="mod_pyamp_web.html"
                        title="next chapter">The web module</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/_generated/pyamp_ui_input_userInput.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="mod_pyamp_web.html" title="The web module"
             >next</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_evdev.html" title="The evdev module"
             >previous</a> |</li>
        <li><a href="../index.html">pyamp v1.2 documentation</a> &raquo;</li>
          <li><a href="mod_pyamp.html" >The pyamp module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui.html" >The ui module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui_input.html" >The input module</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Brett Ponsler.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
    </div>
  </body>
</html>